package hy.util;

import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.apache.ibatis.session.SqlSessionFactoryBuilder;

public class Util {
    static SqlSessionFactory factory;
	static{
		SqlSessionFactoryBuilder builder = new SqlSessionFactoryBuilder();
		factory = builder.build(Util.class.getClassLoader().getResourceAsStream("mc.xml"));
	}
	public static SqlSession getSession(){
		return factory.openSession();
	}
}